import request from '@/utils/request'

// 创建产线工时
export function createLinManHour(data) {
  return request({
    url: '/lamp/lin-man-hour/create',
    method: 'post',
    data: data
  })
}

// 更新产线工时
export function updateLinManHour(data) {
  return request({
    url: '/lamp/lin-man-hour/update',
    method: 'put',
    data: data
  })
}

// 删除产线工时
export function deleteLinManHour(id) {
  return request({
    url: '/lamp/lin-man-hour/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除产线工时 */
export function deleteLinManHourList(ids) {
  return request({
    url: `/lamp/lin-man-hour/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得产线工时
export function getLinManHour(id) {
  return request({
    url: '/lamp/lin-man-hour/get?id=' + id,
    method: 'get'
  })
}

// 获得产线工时分页
export function getLinManHourPage(params) {
  return request({
    url: '/lamp/lin-man-hour/page',
    method: 'get',
    params
  })
}
// 导出产线工时 Excel
export function exportLinManHourExcel(params) {
  return request({
    url: '/lamp/lin-man-hour/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}